package org.aurora.one.threadtype_4;

/**
 * @author : Aurora
 * @date : 2024/3/1 13:40
 * @description 守护线程相关
 */
public class DaemonType {
    public static void main(String[] args) {
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("t1 start");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("t1 end");
            }
        });
        //设置为守护线程
        t1.setDaemon(true);
        t1.start();

    }
}
